#include <iostream>
using namespace std;
int main()
{
 int n,s; s=1;
 cout<<"Vvedite, please, n\n";
 cin>>n;
 cout<<"N yavlyatsya stepen'u troiki?\n";
 while (s<n)
      s=s*3;
  if (s==n) cout<<"True";
  else cout<<"False";
    return 0;
}
